package com.example.targetOffer.service.impl;

import com.example.targetOffer.domain.CQueue;
import com.example.targetOffer.domain.MinStack;
import com.example.targetOffer.service.StackWithQueueService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class StackWithQueueServiceImpl implements StackWithQueueService {
    private final static Logger log = LoggerFactory.getLogger(StackWithQueueServiceImpl.class);

    @Override
    public void appendTail(CQueue queue, int pushValue) {
        log.info(queue.appendTail(pushValue));
    }

    @Override
    public void delHead(CQueue queue) {
        log.info(String.valueOf(queue.deleteHead()));
    }

    @Override
    public void minStack() {
        MinStack minStack = new MinStack();
        minStack.push(0);
        minStack.push(1);
        minStack.push(0);
        log.info(String.valueOf(minStack.min()));
        minStack.pop();
//        log.info(String.valueOf(minStack.top()));
        log.info(String.valueOf(minStack.min()));
    }
}
